import java.util.Scanner;

public class Plant {
    public static void main(String[] args) {
        System.out.println("请输入机票类型");
        Scanner sc = new Scanner(System.in);
        String type = sc.nextLine();
        System.out.println(Prace(255, 8, type));
    }

    public static double Prace(double p, int m, String r) {
        if(m >= 5 && m <= 10) {
            return (r.equals("头等舱") ? (p * 0.9) : (p * 0.85));
        } else {
            return (r.equals("头等舱") ? (p * 0.7) : (p * 0.65));
        }
    }
}
